package io;

import java.io.*;

/**
 * 对象流作用：进行对象的序列化和反序列化
 * 本例演示序列化
 */
public class OosDemo {
    public static void main(String[] args) throws IOException {
        String name = "张三";
        int age = 20;
        String gander = "男";
        String[] otherInfo = {"好","很好","非常好"};
        Person person = new Person(name,age,gander,otherInfo);

        FileOutputStream fos = new FileOutputStream("person.txt");//低级流(文件流)
        ObjectOutput oos = new ObjectOutputStream(fos);//高级流(对象流)

        oos.writeObject(person);//写入对象(序列化)
        System.out.println("写入完毕");
        oos.close();




























    }
}
